<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'user.label', default: 'user')}"/>
    <title>新增柜员</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>进件作业系统</li>
                    <li>
                        <g:link controller="bocUser" action="index">员工柜员管理</g:link>
                    </li>
                    <li class="active">
                        <span>新增柜员</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                员工柜员管理
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                新增柜员
            </div>

            <div class="panel-body">
                <g:form action="save" class="form-horizontal">
                    <g:if test="${flash.message}">
                        <div class="message alert alert-info" role="status">${flash.message}</div>
                    </g:if>
                    <g:hasErrors bean="${this.user}">
                        <ul class="errors" role="alert">
                            <g:eachError bean="${this.user}" var="error">
                                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                                    <g:message error="${error}"/>
                                </li>
                            </g:eachError>
                        </ul>
                    </g:hasErrors>
                    <div class="form-group">
                        <label class="col-md-3 control-label">EHR:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="username" value="${this.user?.username}" id="username"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">柜员名称:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="fullName" value="${this.user?.fullName}" id="fullName"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">密码:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="password" value="${this.user?.password}" id="password"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">手机号码:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="cellphone" value="${this.user?.cellphone}" id="cellphone"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">身份证号:</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="idNumber" value="${this.user?.idNumber}" id="idNumber"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <g:hiddenField name="type" id="type" value="${userType?.id}"/>

                    <div class="form-group">
                        <label class="col-md-3 control-label">客户经理级别:</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="level" optionKey="id" optionValue="name" from="${userLevels}" value="${this.user?.level?.id}" noSelection="['':'-请选择-']"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-3 control-label">所属机构:</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="account" optionKey="id" optionValue="name" from="${accounts}" value="${this.user?.account?.id}" noSelection="['':'-请选择-']"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">岗位:</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="position" optionKey="id" optionValue="name" from="${com.next.Position.list()}" value="${this.user?.position?.id}" noSelection="['':'-请选择-']"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">状态</label>
                        <div class="col-md-3 checkbox-inline">
                            <g:radioGroup class="checkbox-inline" name="enabled" value="${this.user?.enabled}" labels="['启用','关闭']" values="[true,false]">
                                ${it.radio} ${it.label}
                            </g:radioGroup>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-3">
                            <g:submitButton class="btn btn-info" name="create" value="保存"/>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
